<template>
  <div>
     兄弟组件index传来的数据 --------------{{ str }}
  </div>
</template>

<script setup>
import {
  ref,
  reactive,
  toRefs,
  onBeforeMount,
  onBeforeUnmount,
  onMounted,
  watchEffect,
  computed,
} from "vue";
import emitter from "../../utils/bus";
let str = ref("");
emitter.on('send',data=>{
    str.value = data
})
onBeforeUnmount(()=>{
    emitter.off('send')
})
</script>
<style scoped>
</style>